Bump numpy to <2.6.0 - #4111
Open
AlexanderDokuchaev wants to merge 6 commits into
Open
Bump numpy to <2.6.0#4111AlexanderDokuchaev wants to merge 6 commits into
AlexanderDokuchaev wants to merge 6 commits into
Conversation
AlexanderDokuchaev
force-pushed
the
ad/numpy25
branch
from
September 17, 2026 13:02
0f1cf9e to
8a78430
Compare
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The NumPy backend searchsorted return type annotation is incorrect and contradicts the documented dispatcher contract, which can mislead API consumers and type checking.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
This PR updates NNCF’s NumPy compatibility by raising the upper bound to <2.6.0 and adjusting array type annotations/usages across tensor backends to align with newer NumPy typing/stubs.
Changes:
- Bumped NumPy dependency constraint to
<2.6.0. - Replaced
numpy.typing.NDArraywithnp.ndarray[...]-based annotations in multiple tensor backends. - Added/adjusted a few typing suppressions to satisfy stricter type checking with newer NumPy stubs.
| File | Description |
|---|---|
| src/nncf/tensor/functions/torch_numeric.py | Updates NumPy array type annotations and removes an obsolete typing ignore around masked median. |
| src/nncf/tensor/functions/openvino_numeric.py | Adds NumPy import and updates NumPy array type annotations for OpenVINO conversions. |
| src/nncf/tensor/functions/numpy_numeric.py | Updates core NumPy backend array typing and adds typing ignores for stricter overloads; adjusts searchsorted typing. |
| src/nncf/tensor/functions/numpy_linalg.py | Updates NumPy array type alias away from NDArray. |
| src/nncf/tensor/functions/numpy_io.py | Updates NumPy array type alias away from NDArray. |
| src/nncf/quantization/algorithms/weight_compression/constants.py | Adds a typing suppression for slicing-derived quantile centers. |
| pyproject.toml | Bumps NumPy upper version bound to <2.6.0. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Changes
Set
numpy>=1.24.0, <2.6.0for requarementsReplaced
NDArraytonp.ndarray[Any, np.dtype[Any]]Reason for changes
New release of numpy
Related tickets
Tests
https://github.com/openvinotoolkit/nncf/actions/runs/35595737581